package com.zjs.express.service.impl;

import com.zjs.express.bean.Express;
import com.zjs.express.bean.vo.ExpressCountVo;
import com.zjs.express.bean.vo.UserCountVo;
import com.zjs.express.common.ResultModel;
import com.zjs.express.service.ConsoleService;
import com.zjs.express.service.ExpressService;
import com.zjs.express.service.UserService;

import java.util.HashMap;

public class ConsoleServiceImpl implements ConsoleService {
    private UserService userService = new UserServiceImpl();
    private ExpressService expressService = new ExpressServiceImpl();

    /**
     * 统计
     * 用户总人数、日注册量
     * 快递员总人数、日注册量
     * 总快件数、日派单量
     * 待取件数、新增数量
     */
    @Override
    public ResultModel statistics() {
        //获取用户总人数、日注册量、快递员总人数、日注册量
        UserCountVo userCountVo = userService.statistics();
        //总快件数、日派单量、待取件数、快递新增数量
        ExpressCountVo expressCountVo = expressService.statistics();
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put("userCountVo", userCountVo);
        hashMap.put("expressCountVo", expressCountVo);
        return new ResultModel<>(true, "获取统计信息成功", hashMap);
    }
}
